class Player extends Spirit {
  constructor() {
    super('img/player.png')
    this.speed = 5
    this.cooldown = 0
  }
  moveLeft() {
    this.x -= this.speed
  }
  moveRight() {
    this.x += this.speed
  }
  moveUp() {
    this.y -= this.speed
  }
  moveDown() {
    this.y += this.speed
  }
  fire() {
    if (this.cooldown == 0) {
      let bullet = new Bullet(this.x + this.w / 2 - 10, this.y - 10)
      this._scene.add(bullet)
      this.cooldown = 10
    }
    this.cooldown--
  }
}